package xyz.sunne.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.NotBlank;
import xyz.sunne.dto.PermissionDTO;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @author Sunne
 * @version 1.0
 * @date 2021/9/24 0024
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SysRole extends BaseEntity{
    @NotBlank(message = "角色名称不能为空")
    private String name;

    //权限集
    private String permission;

    @TableField(exist = false)
    //临时接收参数对象
    @Size(min = 1, message = "至少需要一个权限")
    @NotNull(message = "权限信息不能为空")
    private List<PermissionDTO> pers;
}
